package com.mf.pte.pojo;

import com.ptc.pfc.pfcAssembly.ComponentPath;
import com.ptc.pfc.pfcFeature.FeatureType;
import com.ptc.pfc.pfcModel.ModelType;

import java.util.ArrayList;
import java.util.List;

public class MyComponent {

    private static final ModelType ASM_TYPE = ModelType.MDL_ASSEMBLY;
    private static final FeatureType COMPONENT_TYPE = FeatureType.FEATTYPE_COMPONENT;

    private List<Integer> id ;
    private List<Integer>  parent_id;
    private String name;
    private int count;

    public void increaseCount(){
        count++;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public MyComponent(){
        id = new ArrayList<>();
        parent_id = new ArrayList<>();
    }

    public List<Integer> getId() {
        return id;
    }

    public String getIdKey(){
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < id.size(); i++) {
            stringBuilder.append(id.get(i));
        }
        return stringBuilder.toString();
    }

    public int getLevel(){
        return id.size();
    }

    public String getParentIdKey(){
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < parent_id.size(); i++) {
            stringBuilder.append(parent_id.get(i));
        }
        return stringBuilder.toString();
    }

    @Override
    public String toString() {
        return "MyComponent{" +
                "id=" + id +
                ", parent_id=" + parent_id +
                ", name='" + name + '\'' +
                ", count=" + count +
                '}';
    }

    public void setId(List<Integer> id) {
        this.id = id;
    }

    public List<Integer> getParent_id() {
        return parent_id;
    }

    public void setParent_id(List<Integer> parent_id) {
        this.parent_id = parent_id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }





}
